/*
#include "Compiler.h"
#include "GenericTypeDefs.h"
#include "HardwareProfile.h"
#include "TimeDelay.h"
*/

/******************************************************************************/
/* User Level #define Macros                                                  */
/******************************************************************************/

/* TODO Application specific user parameters used in user.c may go here */

enum e_SEN_STATE {
    SEN_DO_NOTHING = 0,
    SEN_DO_ASK_SENSOR,
    SEN_DO_WAIT_SENSOR,
    SEN_DO_RECV_DATA,
    SEN_ERR_STATE,
    SEN_DO_RECV_COMPLETE,
    SEN_DO_CALC_DATA
};

enum e_SEN_ERR_STATE_CAUSE {
    SEN_ERR_UNKNOWN_STATE = 0,
    SEN_ERR_NO_ANSWER_FROM_DHT11 = 1,
    SEN_ERR_WRONG_ANSWER_FROM_DHT11 = 2,
    SEN_ERR_NO_LOW_FROM_DHT11 = 3,
    SEN_ERR_TOO_EARLY_HI_FROM_DHT11 = 4,
    SEN_ERR_NO_HI_FROM_DHT11 = 5,
    SEN_ERR_TOO_EARLY_LOW_FROM_DHT11 = 6,
    SEN_ERR_NO_LOW2_FROM_DHT11 = 7,
    SEN_ERR_TOO_EARLY_BIT_HI_FROM_DHT11 = 8,
    SEN_ERR_NO_BIT_HI_FROM_DHT11 = 9,
    SEN_ERR_NO_BIT_LOW_FROM_DHT11 = 10,
    SEN_ERR_WRONG_BIT_DURATION_FROM_DHT11 = 11,
    SEN_ERR_TOO_EARLY_AFTER_BIT_LOW_FROM_DHT11 = 12
};

/******************************************************************************/
/* User Function Prototypes                                                    /
/******************************************************************************/

/* TODO User level functions prototypes (i.e. InitApp) go here */

void DHT11Task(void);

void SensorInit( void );

void GetLastData( char* );

void SensorStartAction( void );

unsigned char SensorGetState( void );

unsigned char SensorGetErrCode( void );


